home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS20.ADF
/
BobEd
/
drawbox.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-01-27
|
2KB
|
63 lines
#include <bobed.h>
/*
drawbox.c
This function draws the edit and object boxes on the screen.
*/
extern struct RastPort *rp;
SHORT boxes [2][HBOBS*VBOBS];
SHORT colorbox [10]; /* array to hold the color selected box co-ords */
VOID drawboxes ()
{
int xx,yy;
int xoffs,yoffs;
int cboxw=(WIDE > 320 ? 2 : 1);
SetAPen (rp,1);
for (yy=0;yy<VBOBS;yy++)
{
yoffs = TOFFSET+(BHIGH+1)*yy+(HIGH-TOFFSET-BOFFSET-BHIGH*VBOBS)/VBOBS*yy;
for (xx=0;xx<HBOBS;xx++)
{
xoffs = HWIDE+(BWIDE*16+1)*xx+(HWIDE-BWIDE*HBOBS*16)/HBOBS*xx;
boxes [0][yy*HBOBS+xx] = xoffs; /* x pt of view box */
boxes [1][yy*HBOBS+xx] = yoffs; /* y pt of view box */
Move (rp, xoffs-1,yoffs-1);
Draw (rp, xoffs+BWIDE*16,yoffs-1);
Draw (rp, xoffs+BWIDE*16,yoffs+BHIGH);
Draw (rp, xoffs-1,yoffs+BHIGH);
Draw (rp, xoffs-1,yoffs-1);
}
}
/* this draws the large edit box on the left of the screen */
Move (rp, LOFFSET-1,TOFFSET-1); /* draw big draw box */
Draw (rp, HWIDE-ROFFSET,TOFFSET-1);
Draw (rp, HWIDE-ROFFSET,HIGH-BOFFSET);
Draw (rp, LOFFSET-1,HIGH-BOFFSET);
Draw (rp, LOFFSET-1,TOFFSET-1);
/*
The colorbox is the small box to the left of the color select gadgets
that shows the currently selected color.
*/
colorbox [0]=WIDE-ROFFSET-30*cboxw; /* could have been initialized as */
colorbox [1]=HIGH-30; /* a border */
colorbox [2]=WIDE-ROFFSET;
colorbox [3]=HIGH-30;
colorbox [4]=WIDE-ROFFSET;
colorbox [5]=HIGH-13;
colorbox [6]=WIDE-ROFFSET-30*cboxw;
colorbox [7]=HIGH-13;
colorbox [8]=WIDE-ROFFSET-30*cboxw;
colorbox [9]=HIGH-30;
Move (rp, colorbox [0],colorbox[1]);
for (xx=2;xx<10;xx+=2)
Draw (rp, colorbox [xx],colorbox[xx+1]);
}